all: server

server: server.o server_msg.o drawing.o groups.o user.o
	gcc server.o server_msg.o drawing.o groups.o user.o -lpthread -o server

server.o: sources/server.c sources/server_msg.c headers/groups.h headers/drawing.h headers/user.h headers/server_msg.h sources/drawing.c headers/groups.h sources/groups.c sources/user.c
	gcc -c -I. sources/server.c sources/server_msg.c sources/drawing.c sources/groups.c sources/user.c

server_msg.o: sources/server_msg.c headers/server_msg.h
	gcc -c -I. sources/server_msg.c

drawing.o: sources/drawing.c headers/drawing.h
	gcc -c -I. sources/drawing.c

groups.o: sources/groups.c headers/groups.h
	gcc -c -I. sources/groups.c

user.o: sources/user.c headers/user.h
	gcc -c -I. sources/user.c

clear:
	rm *.o server
